package com.gjzhao.fmmall.service.feign.fallback;

import com.gjzhao.fmmall.entity.Users;
import com.gjzhao.fmmall.service.feign.UserAddClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @Description: 用户添加 降级类
 * @Author: gjzhao
 * @Date Created in 2022-02-12 11:41 下午
 */
@Component
public class UserAddClientFallback implements UserAddClient {

    private Logger logger = LoggerFactory.getLogger(getClass());

    //如果调用user-add服务添加用户失败，返回-1，表示进入了降级服务
    @Override
    public int add(Users user) {
        logger.info("------调用user-add服务失败，进入降级服务-----");
        return -1;
    }
}
